from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time

driver = webdriver.Chrome()
driver.maximize_window()
driver.get('https://www.baidu.com')
kw = driver.find_element(By.ID, 'kw')
kw.send_keys('天气预报')
kw.send_keys(Keys.CONTROL,'a')
time.sleep(2)
kw.send_keys(Keys.CONTROL, 'c')
time.sleep(2)
driver.get('https://www.so.com')
input = driver.find_element(By.ID, 'input')
input.send_keys(Keys.CONTROL, 'v')
time.sleep(2)
driver.find_element(By.ID, 'search-button').click()
time.sleep(2)
driver.quit()
